{extend name='admin@main'}

{block name="content"}

{include file='store@goods/form_style'}

<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body think-box-shadow padding-left-40">
  <div class="layui-form-item">
    <label class="layui-form-label">内容标题</label>
    <div class="layui-col-xs10" >
      <input name="title" lay-verify="title" value="{$vo.title|default=""}" style="width:500px;" autocomplete="off" placeholder="请输入标题" class="layui-input" type="text">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">内容分类</label>
    <div class="layui-input-inline">
      <select class="layui-select"  name="tid" lay-search>
        {foreach $cates as $cate}
          {if isset($vo.tid) and $vo.tid eq $cate.id}
          <option selected value="{$cate.id}">{$cate.id} - {$cate.title|default=''}</option>
          {else}
          <option value="{$cate.id}">{$cate.id} - {$cate.title|default=''}</option>
          {/if}
        {/foreach}
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">封面图片</label>
      <label class="layui-col-xs4 think-form-group-left" style="width: 24%;">
          <input name="cover" style="width:385px;"  value='{$vo.cover|default=""}' placeholder="请上传分类图片" class="layui-input">
      </label>
      <a class="layui-btn think-form-group-left" data-file="btn" data-field="cover" data-type="png,jpg,gif">
          <i class="layui-icon layui-icon-upload"></i> 上传图片
      </a>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">链接地址</label>
    <div class="layui-col-xs10" >
      <input name="url"  style="width:500px;"  value="{$vo.url|default=""}" autocomplete="off" placeholder="请输入链接地址" class="layui-input" type="text">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-col-xs10" >
      <input name="sort"  style="width:500px;"  value="{$vo.sort|default="50"}" autocomplete="off" placeholder="请输入数值" class="layui-input" type="number">
    </div>
  </div>

  <div class="layui-form-item ">
    <div class="layui-inline">
      <label class="layui-form-label">是否显示</label>
      <div class="layui-input-block">
        <input name="status" value="1" title="是" {eq name='vo.status|default="1"' value='1'} checked {/eq} type="radio">
        <input name="status" value="0" title="否" {eq name='vo.status|default="1"' value='0'} checked {/eq} type="radio">
      </div>
    </div>
  </div>
  <div class="layui-form-item ">
    <div class="layui-inline">
      <label class="layui-form-label">是否置顶</label>
      <div class="layui-input-block">
        <input name="top" value="1" title="是"  {eq name='vo.top|default="0"' value='1'} checked {/eq} type="radio">
        <input name="top" value="0" title="否" {eq name='vo.top|default="0"' value='0'} checked {/eq} type="radio">
      </div>
    </div>
  </div>
  <div class="layui-form-item ">
    <div class="layui-inline">
      <label class="layui-form-label">摘要</label>
      <div class="layui-input-block">
        <textarea name="desc" cols="100" rows="5">{$vo.desc|default=''}</textarea>
      </div>
    </div>
  </div>

  <div class="layui-form-item ">
    <div class="layui-form-item block">
          <span class="label-required-prev color-green">内容</span>
          <textarea name="content">{$vo.content|default=''}</textarea>
    </div>
  </div>
    
  <div class="layui-form-item ">
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
      <button class="layui-btn" type="submit">保存</button>
  </div>
</div>
</form>
{/block}

{block name='script'}

<script>
  window.form.render();
  layui.use('laydate', function(){
    var laydate = layui.laydate;
    //常规用法
    laydate.render({
      elem: '#test1'
    });
    laydate.render({
      elem: '#test2'
    });
    
  });

  require(['ckeditor', 'angular'], function () {
     window.createEditor('[name="content"]', {height: 200});
   });
</script>

{/block}